import React, {Component} from 'react';
import { withRouter } from "react-router-dom"
class Header extends Component {

  goBack =  () => {
   this.props.history.goBack()
  }

  nextPage =  () => {
    this.props.history.goForward()
  }

  render() {
    return (
        <div className="page-header"><h2>React Router Demo</h2>
          <button onClick={ this.goBack }>回退</button>
          <button onClick={ this.nextPage }>前进</button>
        </div>
    );
  }
}

export default withRouter(Header);